package org.jiajie.coffeecodes.concurrent.local;

/**
 * @author jie
 */
public class UserContext {

    private UserContext() {
    }

    private static InheritableThreadLocal<UserEntity> userHolder = new InheritableThreadLocal<UserEntity>();

    public static UserEntity getUser(){
        return userHolder.get();
    }

    public static void setUser(UserEntity user){
        userHolder.set(user);
    }

    public static void clean(){
        userHolder.remove();
    }

}

